
<%@ include file="../common.jsp"%>
<script type="text/javascript">
	$(document).ready(
		
			function() {
				$("#category").attr("action",'<c:url value="/saveDocCategory.htm"></c:url>');
				$("#dcName").focus();
			});
		
</script>
<form:form commandName="documentCategoryForm" id="category">
	<table class="adminFilterTable">
		<tr class="tableChildHeaderColor">
			<td colspan="5" align="center"> ADD DOCUMENT CATEGORY </td>
		</tr>
		<tr class="formSpacingRow"><td></td> </tr>
		<tr class="formSpacingRow"><td></td> </tr>
		<tr>
			<td class="spacingColumnWidthLess"></td>
			<td class="formLabel"> Name* </td>	
			<td class="spacingColumnWidthLess"></td>
			<td class="formField"> <form:input path="dcName" id="dcName"/>
				<form:errors path="dcName" cssClass="errorMessage"></form:errors>
			
			</td>
			<td class="spacingColumnWidthLess"></td> 
		</tr>
		<tr class="formSpacingRow"><td></td> </tr>
		<tr>
			<td class="spacingColumnWidthLess"></td>
			<td class="formLabel"> Code* </td>
			<td class="spacingColumnWidthLess"></td>	
			<td class="formField"> <form:input path="dcCode" id="dcCode"/>
					<form:errors path="dcCode" cssClass="errorMessage"></form:errors>
			</td>
			<td class="spacingColumnWidthLess"></td>
		</tr>
		<tr class="formSpacingRow"><td></td> </tr>
		<tr>
			<td class="spacingColumnWidthLess"></td>
			<td class="formLabel"> Parent Document Type </td>
			<td class="spacingColumnWidthLess"></td>	
			<td class="formField"> <form:select path="dcParentTypeId">
					<c:forEach var="docTypeList" items="${docTypeList}">
						<form:option value="${docTypeList.dtId}">${docTypeList.dtName}</form:option>
					</c:forEach>
				 </form:select>
			</td>
			<td class="spacingColumnWidthLess"></td>
		</tr>	
		<tr class="formSpacingRow"><td></td> </tr>
		<tr align="left">
			<td class="spacingColumnWidthLess"></td>
			<td></td>
			<td class="spacingColumnWidthLess"></td>
			<td colspan="2"> <input class="formButton ui-corner-all" type="button" value="Save" onclick="javascript:addEntity('category')"> </td>
		</tr>	
		<tr class="formSpacingRow"><td></td> </tr>		
	</table>
</form:form>
<c:if test="${errorCount eq 0}">
	<c:choose>
		<c:when test="${resultOfEntry}">
			Operation Done Successfully
		</c:when>
		<c:otherwise>
			<label class="errorMsg"> Error.</label>
		</c:otherwise>
	</c:choose>
</c:if>
<c:if test="${error}">
	<label class="errorMsg"> Document Category under this type already exists.</label>
</c:if>
